Repository navigation
feat: never hold a pull request's CI run behind the run it supersedes (DOTGH-7) - #13
Conversation
… (DOTGH-7) A pull request's runs shared one concurrency group with cancel-in-progress, so GitHub held a new push's run in pending until the run it replaced had fully stopped. A cancelled xcodebuild job takes minutes to stop: on MaudeCode/cowtail#54 a new run waited from 20:02 to 20:06 for one. Every run but a push to the default branch now gets a group of its own, and a pull request's first attempt cancels its older, unfinished runs of the workflow from a `supersede` job through the Actions API, without waiting for them to stop. The job needs actions: write, is continue-on-error since a fork's token cannot cancel, and stays out of CI Gate's needs.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3963cae25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… a query field (DOTGH-7) Filtering by head branch alone also cancelled the runs of another pull request from the same branch to another base, whose merge commit differs. The supersede query now keeps only runs whose pull_requests name this one. A branch name with + or # changed the query when pasted into the URL, so the query fields now go through gh api --method GET -f.
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: c3963cae25
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| group: >- | ||
| ci-${{ github.run_attempt == '1' && (github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) | ||
| || github.event_name == 'push' && github.ref) || format('run-{0}-{1}', github.run_id, github.run_attempt) }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' && github.run_attempt == '1' }} | ||
| ci-${{ github.event_name == 'push' && github.run_attempt == '1' && github.ref | ||
| || format('run-{0}-{1}', github.run_id, github.run_attempt) }} | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Security: Preserve cancellation for fork pull-request runs
When a consumer copies this template and permits fork PR workflows, keep fork runs in a shared per-PR concurrency group. This assigns every PR update a unique group and disables server-side cancellation, while the replacement supersede job explicitly cannot cancel with a fork's read-only token and ignores that failure. A fork author can rapidly push commits so every update starts another full set of jobs, consuming runner concurrency/minutes and delaying other protected CI. Use API cancellation only for same-repository PRs and retain cancel-in-progress for forks.
Useful? React with 👍 / 👎.
Ticket
DOTGH-7
Problem
CI.mdrule 4 put a pull request's runs in one concurrency group withcancel-in-progress. GitHub then holds a new push's run inpendinguntil the superseded run has fully stopped. A cancelledxcodebuildjob on a hosted macOS runner takes about 5 minutes to stop, even after a force-cancel. On MaudeCode/cowtail#54 the new run waited from 20:02:10Z to 20:06:52Z.Solution
supersedejob runs on a pull request's first attempt. It cancels that pull request's older, unfinished runs of the same workflow through the Actions API and does not wait for them to stop. It needsactions: write, iscontinue-on-errorbecause a fork's token cannot cancel, and stays out ofCI Gate'sneeds.CI.mdrule 4 and theci.ymltemplate describe the new behavior.Validation
actionlintpasses on it.Risk
A run of a fork's pull request can't cancel its older runs, and the job's failure is ignored. Those older runs finish instead.
Rollback
Revert. Repositories that adopted the change go back to the old block.